package org.github.manx98.jlibhac.util;

/**
 * @author Manx98
 * @version 1.0
 * @since 2022/10/3 15:42
 */
public class Alignment {
    public static int alignUp(int value, int alignment) {
        return alignDown(value + alignment - 1, alignment);
    }

    private static int alignDown(int value, int alignment) {
        return (value - value % alignment) & 0xFFFF;
    }
}
